<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //解构
        const DUIXIANG = ["蒋富涛", "有钱", "有老婆"];
        //数据解构给变量
        let [a, b, c] = DUIXIANG;
        console.log(a);
        console.log(b);
        console.log(c);
        //对象结构给变量
        const ZHANG = {
            name: "张明飞",
            age: "999",
            kanren: function() {
                console.log("我张明飞会砍人");
            }
        }
        let {
            name,
            age,
            kanren
        } = ZHANG;
        console.log(name);
        console.log(age);
        console.log(kanren);
        kanren()

        //解构
        const DUIXIANG = ["行哥", "富豪", "爱老婆"];
        //数据解构给变量
        let [a, b, c] = DUIXIANG;
        console.log(a);
        console.log(b);
        console.log(c);
        //对象解构给变量
        const XU = {
            name: "行哥",
            age: "18",
            xiongren: function() {
                console.log("我行哥会凶人");
            }
        }
        let {
            name,
            age,
            xiongren
        } = XU;
        console.log(name);
        console.log(age);
        console.log(xiongren);
        xiongren()

        //解构
        const DUIXIANG = ["ymh", "有钱", "爱老婆"];
        //数组解构给变量
        let [a, b, c] = DUIXIANG;
        console.log(a);
        console.log(b);
        console.log(c);
        //对象解构给变量
        const YANG = {
            name: "ymh",
            age: "9999",
            tidao: function() {
                console.log("我ymh会提刀");
            }
        }
        let {
            name,
            age,
            tidao
        } = YANG;
        console.log(name);
        console.log(age);
        console.log(tidao);
        tidao()
    </script>
</body>

</html>